/* 用户数据管理特定样式 */

/* 用户头部信息 */
.user-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 20px;
    flex-wrap: wrap;
}

.user-details h2 {
    margin: 0 0 5px 0;
    color: #1f2937;
}

.user-details p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.logout-btn {
    background: #ef4444;
    margin-top: 15px;
}

.logout-btn:hover {
    background: #dc2626;
}

/* 快速操作 */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    flex-wrap: wrap;
}

.quick-actions .icon {
    margin-right: 5px;
    font-weight: bold;
}

.stats {
    margin-left: auto;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
}

/* 搜索筛选 */
.search-filters {
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}

.filter-group {
    display: grid;
    grid-template-columns: 1fr 200px auto auto;
    gap: 15px;
    align-items: end;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    width: 150px;
}

/* 数据表格容器 */
.data-table-container {
    position: relative;
    min-height: 200px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.data-table-container::after {
    content: "← 滚动查看完整表格 →";
    display: block;
    text-align: center;
    padding: 10px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    border-top: 1px solid #e5e7eb;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    background: white;
}

.data-table tr:hover td {
    background: #f9fafb;
}

/* 列宽调整 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 180px;
    min-width: 180px;
    white-space: normal;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 120px;
    min-width: 120px;
    text-align: center;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 150px;
    min-width: 150px;
    text-align: center;
}

/* JSON 预览 */
.json-preview {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    background: #f8fafc;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
    display: block;
    cursor: pointer;
    transition: background-color 0.2s;
}

.json-preview:hover {
    background: #e5e7eb;
}

/* 数据类型标签 */
.data-type {
    display: inline-block;
    padding: 4px 8px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 操作按钮组 */
.actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
}

/* 加载状态 */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #374151;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    padding: 20px;
}

/* 表单布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px 0;
}

#page-info {
    color: #6b7280;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .user-header {
        flex-direction: column;
        text-align: center;
        margin: 10px;
    }

    .quick-actions {
        justify-content: center;
    }

    .stats {
        margin-left: 0;
    }

    .filter-group {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .data-table {
        min-width: 500px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .json-preview {
        max-width: 150px;
        font-size: 10px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (min-width: 1200px) {
    .data-table-container::after {
        display: none;
    }
}